/**
 * 匠言知识付费v2.0.0
 * Author: 山西匠言网络科技有限公司
 * 这不是一个免费软件，它受限于许可条款，你可以访问https://www.zsfzxkc.cn/获取更多详细信息。
 * This is not a free software, it under the license terms, you can visit https://www.zsffzxkc.cn/ get more details.
 */
<template>
	<view class="container">
		<jy-quick-btns></jy-quick-btns>
		<view class="beijing">
			<image src="../static/exam.jpg" mode="aspectFill"></image>
			<view class="info">
				<image :src="userinfo.avatar" mode="aspectFill"></image>
				<text>{{userinfo.nickname}}</text>
			</view>
		</view>
		
		<!-- 列表部分 -->
		<view class="teacher-center-list">
			<view class="teacher-center-list-item" @click="navigate('myExam')">
				<view class="item-left">
					<image src="../static/myexam.png" mode="aspectFit"></image>
					<text>我的考试</text>
				</view>
			</view>
			<view class="teacher-center-list-item" @click="navigate('biji')">
				<view class="item-left">
					<image src="../static/biji.png" mode="aspectFit"></image>
					<text>我的笔记</text>
				</view>
			</view>
			<view class="teacher-center-list-item" @click="navigate('shoucang')">
				<view class="item-left">
					<image src="../static/myshoucang.png" mode="aspectFit"></image>
					<text>我的收藏</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {checkUserinfo} from '@/request/checkUserinfo'
	export default {
		data() {
			return {
				userinfo: {},
			};
		},
		onShareAppMessage(res) {
			let path = getCurrentPages()
			let path_share = path[0].$page.fullPath
			let path_title = path[0].data.title
			let userinfo = uni.getStorageSync('userinfo')
			let base_set = uni.getStorageSync('base_set')
			if(userinfo.uid=='' || !userinfo.uid){
				uni.navigateTo({
					url:'../login/login'
				})
				return {
					title: '请先登录后再分享给好友',
					path: ''
				}
			}else{
				if (res.from === 'button') {
					
				}
				return {
					title: base_set.title,
					path: `${path_share}?pid=${userinfo.uid}`
				}
			}
		},
		onLoad() {
			
		},
		onShow() {
			checkUserinfo()
			let userinfo=uni.getStorageSync('userinfo')
			this.userinfo = userinfo.userdata
		},
		methods: {
			navigate (e) {
				if(e=='myExam'){
					uni.navigateTo({
						url: `../${e}/myExam1`
					});
				}else if(e=='biji' || e=='shoucang'){
					uni.navigateTo({
						url: `../examDetail/examDetail1?type=${e}`
					});
				}
			}
		}
	}
</script>

<style lang="less" scoped>
.beijing {
	image {
		width: 750upx;
		height: 275upx;
	}
	.info {
		display: flex;
		flex-direction: column;
		align-items: center;
		position: absolute;
		top: 30upx;
		left: 300upx;
		image {
			width: 120upx;
			height: 120upx;
			border-radius: 50%;
		}
		text {
			font-size: 30upx;
			color: #fff;
			text-shadow:#555 6upx 8upx 10upx;
			margin-top: 20upx;
		}
	}
}

.teacher-center-list {
	&-item {
		height: 100upx;
		padding: 0 30upx;
		border-bottom: 2upx solid #ddd;
		background-color: #fff;
		display: flex;
		align-items: center;
		justify-content: space-between;
		.item-left {
			display: flex;
			align-items: center;
			image {
				width: 60upx;
				height: 60upx;
			}
			text {
				font-size: 30upx;
				color: #333;
				margin-left: 30upx;
			}
		}
		.item-right {
			width: 20upx;
			height: 30upx;
		}
	}
}
.verify{
	text-align: center;
	font-size: 32upx;
	padding-top: 50upx;
	button{
		width: 60%;
		margin-top: 100upx;
	}
}
</style>
